package ningbo.day07.oop;

import java.sql.SQLOutput;

/**
 * @Author 宁铂
 * @Date 2021/7/18 14:41
 * @Version 1.0
 */
public class TestThis1 {
    /** 创建成员变量与局部变量同名时,this的使用情况 */
    public static void main(String[] args) {
        Cat cat = new Cat(5);
    }

}

class Cat{
    String name = "wud";
    Cat(){
        System.out.println("无参");
    }
    Cat(int a){
        this();
        System.out.println("含参");
    }

    public void dog(){
        String name = "dw";
        System.out.println(name);
        System.out.println(this.name);

    }
}